//
//  WodeqianbaoTableViewCell.m
//  tianjin
//
//  Created by 鞠超 on 16/8/11.
//  Copyright © 2016年 jc. All rights reserved.
//

#import "WodeqianbaoTableViewCell.h"

@implementation WodeqianbaoTableViewCell

- (instancetype )initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if(self)
    {
        [self p_setupView];
    }
    
    return self;
}

- (void )p_setupView
{
    self.image = [[UIImageView alloc] init];
    self.image.image = [UIImage imageNamed:@"kaipian_1212@2x.png"];
    [self.contentView addSubview:self.image];
    
    self.danhao = [[UILabel alloc] init];
    self.danhao.text = @"单号 1234567890123";
    self.danhao.textColor = [UIColor grayColor];
    self.danhao.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.danhao];
    
    //
    self.date = [[UILabel alloc] init];
    self.date.text = @"时间 2016-12-12";
    self.date.textColor = [UIColor grayColor];
    self.date.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.date];
    
    //
    self.price = [[UILabel alloc] init];
    self.price.textColor = navi_bar_bg_color;
    self.price.text = @"+50.0";
    self.price.textAlignment = NSTextAlignmentRight;
    self.price.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:self.price];
    
    self.type = [[UILabel alloc] init];
    self.type.textAlignment = NSTextAlignmentRight;
    self.type.textColor = [UIColor orangeColor];
    self.type.text = @"已完成";
    self.type.font = [UIFont systemFontOfSize:12];
    [self.contentView addSubview:self.type];
    
    //
    self.view_line = [[UIView alloc] init];
    self.view_line.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [self.contentView addSubview:self.view_line];
}

- (void )layoutSubviews
{
    [super layoutSubviews];
    
    self.image.frame = CGRectMake(10, 22.5, 35, 35);
    
    self.danhao.frame = CGRectMake(CGRectGetMaxX(self.image.frame) + 15, CGRectGetMinY(self.image.frame), SCREEN_WIDTH - CGRectGetMaxX(self.image.frame) - 15 - 10 - 60, 15);
    
    self.date.frame = CGRectMake(CGRectGetMinX(self.danhao.frame), CGRectGetMaxY(self.danhao.frame) + 10, SCREEN_WIDTH - CGRectGetMaxX(self.image.frame) - 15 - 10 - 60, 15);
    
    self.price.frame = CGRectMake(SCREEN_WIDTH - 10 - 60, 20, 60, 20);

    self.type.frame = CGRectMake(SCREEN_WIDTH - 10 - 60, CGRectGetMaxY(self.price.frame) + 10, 60, 15);
    
    self.view_line.frame = CGRectMake(0, 80, SCREEN_WIDTH, 10);
    
}











@end
